package com.aaa.sb.service;

import com.aaa.sb.dao.NewsDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * className:NewsServiceImpl
 * discription:
 * author:luRuiHua
 * createTime:2018-11-22 11:05
 */
@Service
public class NewsServiceImpl implements NewsService {
    //依赖注入
    @Autowired
    private NewsDao newsDao;
    /**
     * 新闻列表
     * @return
     */
    @Override
    public List<Map> getList() {
        return newsDao.getList();
    }

    /**
     * 新闻添加
     * @param map
     * @return
     */
    @Override
    public int add(Map map) {
        return newsDao.add(map);
    }

    /**
     * 新闻更改
     * @param map
     * @return
     */
    @Override
    public int updateOne(Map map) {
        return newsDao.updateOne(map);
    }

    /**
     * 通过id查新闻
     * @param paramMap
     * @return
     */
    @Override
    public List<Map> selectNewsMsgById(Map paramMap) {
        return newsDao.selectNewsMsgById(paramMap);
    }

    /**
     * 新闻删除
     * @param map
     * @return
     */
    @Override
    public int toDelete(Map map) {
        int i = newsDao.toDelete(map);
        return i;
    }
}
